#!/bin/bash

# default device name
mydev="/dev/sdd"

# the icon 
sd_icon="/usr/share/icons/Human/scalable/devices/media-flash.svg"

# check my command arguments 
if [ $# -gt 0 ]; then
	mydev=$1
fi

# create the message 
mymsg="dd image to $mydev finished"
mytitle="Copying SD card image"

# get my resolution
myres=$(xrandr -q|grep '*' | sed -e 's/x.*//' -e 's/\ //g')

# the sound
mysound="/usr/share/sounds/purple/receive.wav"

# and the notify command
notify-send -i $sd_icon -h int:x:$myres -h int:y:10 -u normal -t 10000 "$mytitle" "$mymsg"'!' & mplayer $mysound
